<?php
/**
 * User: WL
 * Time: 12-10-13 - 上午9:14
 * File: list.inc.php
 * Project For ixdcw.com
 */
defined('IN_IXDCW') or exit('Access Denied');
require DT_CORE.'/'.$module.'/common.inc.php';
require_once DT_INC.'/post.func.php';
ViewCheck::catExists() or Prompt::listNotFound();
ViewCheck::groupListPermission() or Prompt::noPermission();
$saledDb = Db('auto_sale');
$do      = new AutoSaleModule();
if($modelid) {
	$model      = AutoModel::get($modelid);
    $brand_name = Auto::getName($model['arbid']);//品牌
	$make_name  = Auto::getName($model['armid']);//生产商
    $car_name   = Auto::getName($model['arcid']);//车系
    $model_name = $model['name'];                //车系
   if(!empty($model['body_color'])) $color  = explode(' ',trim($model['body_color']));//车款颜色
}elseif($carid){
	$car      =  AutoCar::get($carid);
	$brand_name = Auto::getName($car['parentid']);//品牌
	$car_name   = $car['name'];//车系
}
if($submit){
	login();
	if($do->pass($post)){
		$post['username'] = $_username;
		$post['addtime']  = $DT_TIME;
		$post['ip']       = $DT_IP;
		$post['status']    = 3;
		$post['ps'] = Str::addSlashes($post['ps']);
		$saledDb->add($post);
		Prompt::message('您已报名成功！我们的客服将尽快与您联系！','?','8');
	}else{
		Prompt::message($do->getErrmsg());
	}
}

$seo_file = 'index';
include DT_INC.'/seo.inc.php';
include template('sale', $module);

